package cz.muni.fi.pa165.musiclibrary.api.database.dao;

import cz.muni.fi.pa165.musiclibrary.api.database.entity.IAlbum;
import java.util.List;
import org.joda.time.LocalDate;

/**
*
* @author Martin Majlath
* 2012-10-10T16:21:29+0200
*/
public interface IAlbumDAO {
    
     /**
     * Create and add new entry of album to DB
     * 
     * @throws TBD
     * @param album 
     */
    void create(final IAlbum album);
    
    /**
     * Edit existing entry album selected by parameter {@code album}
     * 
     * @throws TBD
     * @param album to be updated
     */
    void update(final IAlbum album);
     
    /**
     * Remove entry album by given parameter {@code album}
     * 
     * @throws TBD
     * @param album to be removed
     */
    void delete(final IAlbum album);
     
    /**
     * Find and return entity by ({@link #getIdAlbum()})
     * 
     * @throws TBD
     * @param id defines which entry should be found
     * @return adequate entity album
     * TBD(if not found)
     */   
    IAlbum getById(final Long id);
    
    /**
     * Create and return collection of all albums in DB
     * 
     * @throws TBD
     * @return collection of all albums in DB, if there is no albums, returns empty collection 
     */
    List<IAlbum> getAll();
    
     /**
     * Create and return collection of all albums in DB, 
     * with title like parameter {@code title} (full text search)
     * 
     * @throws TBD
     * @return collection of all albums in DB with given title, if there is no such album, returns empty collection 
     */
    List<IAlbum> getByTitle(final String title);
    
    /**
     * Create and return collection of all albums in DB, 
     * with date matching parameter {@code date} 
     * 
     * @throws TBD
     * @return collection of all albums in DB with given date, if there is no such album, returns empty collection 
     */
    List<IAlbum> getByReleaseDate(final LocalDate date);
}
